// Generated from SandyParser.g4 by ANTLR 4.8
package com.xy.annotaion.handler.kotlin.compiler.demo0.antlr.parser;

import org.antlr.v4.runtime.*;
import org.antlr.v4.runtime.atn.ATN;
import org.antlr.v4.runtime.atn.ATNDeserializer;
import org.antlr.v4.runtime.atn.ParserATNSimulator;
import org.antlr.v4.runtime.atn.PredictionContextCache;
import org.antlr.v4.runtime.dfa.DFA;
import org.antlr.v4.runtime.tree.ParseTreeListener;
import org.antlr.v4.runtime.tree.TerminalNode;

import java.util.List;

@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
public class SandyParser extends Parser {
	static {
		RuntimeMetaData.checkVersion("4.8", RuntimeMetaData.VERSION);
	}

	protected static final DFA[] _decisionToDFA;
	protected static final PredictionContextCache _sharedContextCache =
			new PredictionContextCache();
	public static final int
			NEWLINE = 1, WS = 2, VAR = 3, PRINT = 4, AS = 5, INT = 6, DECIMAL = 7, INTLIT = 8, DECLIT = 9,
			PLUS = 10, MINUS = 11, ASTERISK = 12, DIVISION = 13, ASSIGN = 14, LPAREN = 15, RPAREN = 16,
			ID = 17;
	public static final int
			RULE_sandyFile = 0, RULE_line = 1, RULE_statement = 2, RULE_print = 3,
			RULE_varDeclaration = 4, RULE_assignment = 5, RULE_expression = 6, RULE_type = 7;

	private static String[] makeRuleNames() {
		return new String[]{
				"sandyFile", "line", "statement", "print", "varDeclaration", "assignment",
				"expression", "type"
		};
	}

	public static final String[] ruleNames = makeRuleNames();

	private static String[] makeLiteralNames() {
		return new String[]{
				null, null, null, "'var'", "'print'", "'as'", "'Int'", "'Decimal'", null,
				null, "'+'", "'-'", "'*'", "'/'", "'='", "'('", "')'"
		};
	}

	private static final String[] _LITERAL_NAMES = makeLiteralNames();

	private static String[] makeSymbolicNames() {
		return new String[]{
				null, "NEWLINE", "WS", "VAR", "PRINT", "AS", "INT", "DECIMAL", "INTLIT",
				"DECLIT", "PLUS", "MINUS", "ASTERISK", "DIVISION", "ASSIGN", "LPAREN",
				"RPAREN", "ID"
		};
	}

	private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames();
	public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);

	/**
	 * @deprecated Use {@link #VOCABULARY} instead.
	 */
	@Deprecated
	public static final String[] tokenNames;

	static {
		tokenNames = new String[_SYMBOLIC_NAMES.length];
		for (int i = 0; i < tokenNames.length; i++) {
			tokenNames[i] = VOCABULARY.getLiteralName(i);
			if (tokenNames[i] == null) {
				tokenNames[i] = VOCABULARY.getSymbolicName(i);
			}

			if (tokenNames[i] == null) {
				tokenNames[i] = "<INVALID>";
			}
		}
	}

	@Override
	@Deprecated
	public String[] getTokenNames() {
		return tokenNames;
	}

	@Override

	public Vocabulary getVocabulary() {
		return VOCABULARY;
	}

	@Override
	public String getGrammarFileName() {
		return "SandyParser.g4";
	}

	@Override
	public String[] getRuleNames() {
		return ruleNames;
	}

	@Override
	public String getSerializedATN() {
		return _serializedATN;
	}

	@Override
	public ATN getATN() {
		return _ATN;
	}

	public SandyParser(TokenStream input) {
		super(input);
		_interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache);
	}

	public static class SandyFileContext extends ParserRuleContext {
		public LineContext lines;

		public List<LineContext> line() {
			return getRuleContexts(LineContext.class);
		}

		public LineContext line(int i) {
			return getRuleContext(LineContext.class, i);
		}

		public SandyFileContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}

		@Override
		public int getRuleIndex() {
			return RULE_sandyFile;
		}

		@Override
		public void enterRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener) ((SandyParserListener) listener).enterSandyFile(this);
		}

		@Override
		public void exitRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener) ((SandyParserListener) listener).exitSandyFile(this);
		}
	}

	public final SandyFileContext sandyFile() throws RecognitionException {
		SandyFileContext _localctx = new SandyFileContext(_ctx, getState());
		enterRule(_localctx, 0, RULE_sandyFile);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
				setState(17);
				_errHandler.sync(this);
				_la = _input.LA(1);
				do {
					{
						{
							setState(16);
							((SandyFileContext) _localctx).lines = line();
						}
					}
					setState(19);
					_errHandler.sync(this);
					_la = _input.LA(1);
				} while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << VAR) | (1L << PRINT) | (1L << ID))) != 0));
			}
		} catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		} finally {
			exitRule();
		}
		return _localctx;
	}

	public static class LineContext extends ParserRuleContext {
		public StatementContext statement() {
			return getRuleContext(StatementContext.class, 0);
		}

		public TerminalNode NEWLINE() {
			return getToken(SandyParser.NEWLINE, 0);
		}

		public TerminalNode EOF() {
			return getToken(SandyParser.EOF, 0);
		}

		public LineContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}

		@Override
		public int getRuleIndex() {
			return RULE_line;
		}

		@Override
		public void enterRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener) ((SandyParserListener) listener).enterLine(this);
		}

		@Override
		public void exitRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener) ((SandyParserListener) listener).exitLine(this);
		}
	}

	public final LineContext line() throws RecognitionException {
		LineContext _localctx = new LineContext(_ctx, getState());
		enterRule(_localctx, 2, RULE_line);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
				setState(21);
				statement();
				setState(22);
				_la = _input.LA(1);
				if (!(_la == EOF || _la == NEWLINE)) {
					_errHandler.recoverInline(this);
				} else {
					if (_input.LA(1) == Token.EOF) matchedEOF = true;
					_errHandler.reportMatch(this);
					consume();
				}
			}
		} catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		} finally {
			exitRule();
		}
		return _localctx;
	}

	public static class StatementContext extends ParserRuleContext {
		public StatementContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}

		@Override
		public int getRuleIndex() {
			return RULE_statement;
		}

		public StatementContext() {
		}

		public void copyFrom(StatementContext ctx) {
			super.copyFrom(ctx);
		}
	}

	public static class PrintStatementContext extends StatementContext {
		public PrintContext print() {
			return getRuleContext(PrintContext.class, 0);
		}

		public PrintStatementContext(StatementContext ctx) {
			copyFrom(ctx);
		}

		@Override
		public void enterRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener) ((SandyParserListener) listener).enterPrintStatement(this);
		}

		@Override
		public void exitRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener) ((SandyParserListener) listener).exitPrintStatement(this);
		}
	}

	public static class AssignmentStatementContext extends StatementContext {
		public AssignmentContext assignment() {
			return getRuleContext(AssignmentContext.class, 0);
		}

		public AssignmentStatementContext(StatementContext ctx) {
			copyFrom(ctx);
		}

		@Override
		public void enterRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener)
				((SandyParserListener) listener).enterAssignmentStatement(this);
		}

		@Override
		public void exitRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener) ((SandyParserListener) listener).exitAssignmentStatement(this);
		}
	}

	public static class VarDeclarationStatementContext extends StatementContext {
		public VarDeclarationContext varDeclaration() {
			return getRuleContext(VarDeclarationContext.class, 0);
		}

		public VarDeclarationStatementContext(StatementContext ctx) {
			copyFrom(ctx);
		}

		@Override
		public void enterRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener)
				((SandyParserListener) listener).enterVarDeclarationStatement(this);
		}

		@Override
		public void exitRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener)
				((SandyParserListener) listener).exitVarDeclarationStatement(this);
		}
	}

	public final StatementContext statement() throws RecognitionException {
		StatementContext _localctx = new StatementContext(_ctx, getState());
		enterRule(_localctx, 4, RULE_statement);
		try {
			setState(27);
			_errHandler.sync(this);
			switch (_input.LA(1)) {
				case VAR:
					_localctx = new VarDeclarationStatementContext(_localctx);
					enterOuterAlt(_localctx, 1);
				{
					setState(24);
					varDeclaration();
				}
				break;
				case ID:
					_localctx = new AssignmentStatementContext(_localctx);
					enterOuterAlt(_localctx, 2);
				{
					setState(25);
					assignment();
				}
				break;
				case PRINT:
					_localctx = new PrintStatementContext(_localctx);
					enterOuterAlt(_localctx, 3);
				{
					setState(26);
					print();
				}
				break;
				default:
					throw new NoViableAltException(this);
			}
		} catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		} finally {
			exitRule();
		}
		return _localctx;
	}

	public static class PrintContext extends ParserRuleContext {
		public TerminalNode PRINT() {
			return getToken(SandyParser.PRINT, 0);
		}

		public TerminalNode LPAREN() {
			return getToken(SandyParser.LPAREN, 0);
		}

		public ExpressionContext expression() {
			return getRuleContext(ExpressionContext.class, 0);
		}

		public TerminalNode RPAREN() {
			return getToken(SandyParser.RPAREN, 0);
		}

		public PrintContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}

		@Override
		public int getRuleIndex() {
			return RULE_print;
		}

		@Override
		public void enterRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener) ((SandyParserListener) listener).enterPrint(this);
		}

		@Override
		public void exitRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener) ((SandyParserListener) listener).exitPrint(this);
		}
	}

	public final PrintContext print() throws RecognitionException {
		PrintContext _localctx = new PrintContext(_ctx, getState());
		enterRule(_localctx, 6, RULE_print);
		try {
			enterOuterAlt(_localctx, 1);
			{
				setState(29);
				match(PRINT);
				setState(30);
				match(LPAREN);
				setState(31);
				expression(0);
				setState(32);
				match(RPAREN);
			}
		} catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		} finally {
			exitRule();
		}
		return _localctx;
	}

	public static class VarDeclarationContext extends ParserRuleContext {
		public TerminalNode VAR() {
			return getToken(SandyParser.VAR, 0);
		}

		public AssignmentContext assignment() {
			return getRuleContext(AssignmentContext.class, 0);
		}

		public VarDeclarationContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}

		@Override
		public int getRuleIndex() {
			return RULE_varDeclaration;
		}

		@Override
		public void enterRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener) ((SandyParserListener) listener).enterVarDeclaration(this);
		}

		@Override
		public void exitRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener) ((SandyParserListener) listener).exitVarDeclaration(this);
		}
	}

	public final VarDeclarationContext varDeclaration() throws RecognitionException {
		VarDeclarationContext _localctx = new VarDeclarationContext(_ctx, getState());
		enterRule(_localctx, 8, RULE_varDeclaration);
		try {
			enterOuterAlt(_localctx, 1);
			{
				setState(34);
				match(VAR);
				setState(35);
				assignment();
			}
		} catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		} finally {
			exitRule();
		}
		return _localctx;
	}

	public static class AssignmentContext extends ParserRuleContext {
		public TerminalNode ID() {
			return getToken(SandyParser.ID, 0);
		}

		public TerminalNode ASSIGN() {
			return getToken(SandyParser.ASSIGN, 0);
		}

		public ExpressionContext expression() {
			return getRuleContext(ExpressionContext.class, 0);
		}

		public AssignmentContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}

		@Override
		public int getRuleIndex() {
			return RULE_assignment;
		}

		@Override
		public void enterRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener) ((SandyParserListener) listener).enterAssignment(this);
		}

		@Override
		public void exitRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener) ((SandyParserListener) listener).exitAssignment(this);
		}
	}

	public final AssignmentContext assignment() throws RecognitionException {
		AssignmentContext _localctx = new AssignmentContext(_ctx, getState());
		enterRule(_localctx, 10, RULE_assignment);
		try {
			enterOuterAlt(_localctx, 1);
			{
				setState(37);
				match(ID);
				setState(38);
				match(ASSIGN);
				setState(39);
				expression(0);
			}
		} catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		} finally {
			exitRule();
		}
		return _localctx;
	}

	public static class ExpressionContext extends ParserRuleContext {
		public ExpressionContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}

		@Override
		public int getRuleIndex() {
			return RULE_expression;
		}

		public ExpressionContext() {
		}

		public void copyFrom(ExpressionContext ctx) {
			super.copyFrom(ctx);
		}
	}

	public static class DecimalLiteralContext extends ExpressionContext {
		public TerminalNode DECLIT() {
			return getToken(SandyParser.DECLIT, 0);
		}

		public DecimalLiteralContext(ExpressionContext ctx) {
			copyFrom(ctx);
		}

		@Override
		public void enterRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener) ((SandyParserListener) listener).enterDecimalLiteral(this);
		}

		@Override
		public void exitRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener) ((SandyParserListener) listener).exitDecimalLiteral(this);
		}
	}

	public static class MinusExpressionContext extends ExpressionContext {
		public TerminalNode MINUS() {
			return getToken(SandyParser.MINUS, 0);
		}

		public ExpressionContext expression() {
			return getRuleContext(ExpressionContext.class, 0);
		}

		public MinusExpressionContext(ExpressionContext ctx) {
			copyFrom(ctx);
		}

		@Override
		public void enterRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener) ((SandyParserListener) listener).enterMinusExpression(this);
		}

		@Override
		public void exitRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener) ((SandyParserListener) listener).exitMinusExpression(this);
		}
	}

	public static class IntLiteralContext extends ExpressionContext {
		public TerminalNode INTLIT() {
			return getToken(SandyParser.INTLIT, 0);
		}

		public IntLiteralContext(ExpressionContext ctx) {
			copyFrom(ctx);
		}

		@Override
		public void enterRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener) ((SandyParserListener) listener).enterIntLiteral(this);
		}

		@Override
		public void exitRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener) ((SandyParserListener) listener).exitIntLiteral(this);
		}
	}

	public static class ParenExpressionContext extends ExpressionContext {
		public TerminalNode LPAREN() {
			return getToken(SandyParser.LPAREN, 0);
		}

		public ExpressionContext expression() {
			return getRuleContext(ExpressionContext.class, 0);
		}

		public TerminalNode RPAREN() {
			return getToken(SandyParser.RPAREN, 0);
		}

		public ParenExpressionContext(ExpressionContext ctx) {
			copyFrom(ctx);
		}

		@Override
		public void enterRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener) ((SandyParserListener) listener).enterParenExpression(this);
		}

		@Override
		public void exitRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener) ((SandyParserListener) listener).exitParenExpression(this);
		}
	}

	public static class BinaryOperationContext extends ExpressionContext {
		public ExpressionContext left;
		public Token operator;
		public ExpressionContext right;

		public List<ExpressionContext> expression() {
			return getRuleContexts(ExpressionContext.class);
		}

		public ExpressionContext expression(int i) {
			return getRuleContext(ExpressionContext.class, i);
		}

		public TerminalNode DIVISION() {
			return getToken(SandyParser.DIVISION, 0);
		}

		public TerminalNode ASTERISK() {
			return getToken(SandyParser.ASTERISK, 0);
		}

		public TerminalNode PLUS() {
			return getToken(SandyParser.PLUS, 0);
		}

		public TerminalNode MINUS() {
			return getToken(SandyParser.MINUS, 0);
		}

		public BinaryOperationContext(ExpressionContext ctx) {
			copyFrom(ctx);
		}

		@Override
		public void enterRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener) ((SandyParserListener) listener).enterBinaryOperation(this);
		}

		@Override
		public void exitRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener) ((SandyParserListener) listener).exitBinaryOperation(this);
		}
	}

	public static class TypeConversionContext extends ExpressionContext {
		public ExpressionContext value;
		public TypeContext targetType;

		public TerminalNode AS() {
			return getToken(SandyParser.AS, 0);
		}

		public ExpressionContext expression() {
			return getRuleContext(ExpressionContext.class, 0);
		}

		public TypeContext type() {
			return getRuleContext(TypeContext.class, 0);
		}

		public TypeConversionContext(ExpressionContext ctx) {
			copyFrom(ctx);
		}

		@Override
		public void enterRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener) ((SandyParserListener) listener).enterTypeConversion(this);
		}

		@Override
		public void exitRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener) ((SandyParserListener) listener).exitTypeConversion(this);
		}
	}

	public static class VarReferenceContext extends ExpressionContext {
		public TerminalNode ID() {
			return getToken(SandyParser.ID, 0);
		}

		public VarReferenceContext(ExpressionContext ctx) {
			copyFrom(ctx);
		}

		@Override
		public void enterRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener) ((SandyParserListener) listener).enterVarReference(this);
		}

		@Override
		public void exitRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener) ((SandyParserListener) listener).exitVarReference(this);
		}
	}

	public final ExpressionContext expression() throws RecognitionException {
		return expression(0);
	}

	private ExpressionContext expression(int _p) throws RecognitionException {
		ParserRuleContext _parentctx = _ctx;
		int _parentState = getState();
		ExpressionContext _localctx = new ExpressionContext(_ctx, _parentState);
		ExpressionContext _prevctx = _localctx;
		int _startState = 12;
		enterRecursionRule(_localctx, 12, RULE_expression, _p);
		int _la;
		try {
			int _alt;
			enterOuterAlt(_localctx, 1);
			{
				setState(51);
				_errHandler.sync(this);
				switch (_input.LA(1)) {
					case LPAREN: {
						_localctx = new ParenExpressionContext(_localctx);
						_ctx = _localctx;
						_prevctx = _localctx;

						setState(42);
						match(LPAREN);
						setState(43);
						expression(0);
						setState(44);
						match(RPAREN);
					}
					break;
					case ID: {
						_localctx = new VarReferenceContext(_localctx);
						_ctx = _localctx;
						_prevctx = _localctx;
						setState(46);
						match(ID);
					}
					break;
					case MINUS: {
						_localctx = new MinusExpressionContext(_localctx);
						_ctx = _localctx;
						_prevctx = _localctx;
						setState(47);
						match(MINUS);
						setState(48);
						expression(3);
					}
					break;
					case INTLIT: {
						_localctx = new IntLiteralContext(_localctx);
						_ctx = _localctx;
						_prevctx = _localctx;
						setState(49);
						match(INTLIT);
					}
					break;
					case DECLIT: {
						_localctx = new DecimalLiteralContext(_localctx);
						_ctx = _localctx;
						_prevctx = _localctx;
						setState(50);
						match(DECLIT);
					}
					break;
					default:
						throw new NoViableAltException(this);
				}
				_ctx.stop = _input.LT(-1);
				setState(64);
				_errHandler.sync(this);
				_alt = getInterpreter().adaptivePredict(_input, 4, _ctx);
				while (_alt != 2 && _alt != org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER) {
					if (_alt == 1) {
						if (_parseListeners != null) triggerExitRuleEvent();
						_prevctx = _localctx;
						{
							setState(62);
							_errHandler.sync(this);
							switch (getInterpreter().adaptivePredict(_input, 3, _ctx)) {
								case 1: {
									_localctx = new BinaryOperationContext(new ExpressionContext(_parentctx, _parentState));
									((BinaryOperationContext) _localctx).left = _prevctx;
									pushNewRecursionContext(_localctx, _startState, RULE_expression);
									setState(53);
									if (!(precpred(_ctx, 8)))
										throw new FailedPredicateException(this, "precpred(_ctx, 8)");
									setState(54);
									((BinaryOperationContext) _localctx).operator = _input.LT(1);
									_la = _input.LA(1);
									if (!(_la == ASTERISK || _la == DIVISION)) {
										((BinaryOperationContext) _localctx).operator = (Token) _errHandler.recoverInline(this);
									} else {
										if (_input.LA(1) == Token.EOF) matchedEOF = true;
										_errHandler.reportMatch(this);
										consume();
									}
									setState(55);
									((BinaryOperationContext) _localctx).right = expression(9);
								}
								break;
								case 2: {
									_localctx = new BinaryOperationContext(new ExpressionContext(_parentctx, _parentState));
									((BinaryOperationContext) _localctx).left = _prevctx;
									pushNewRecursionContext(_localctx, _startState, RULE_expression);
									setState(56);
									if (!(precpred(_ctx, 7)))
										throw new FailedPredicateException(this, "precpred(_ctx, 7)");
									setState(57);
									((BinaryOperationContext) _localctx).operator = _input.LT(1);
									_la = _input.LA(1);
									if (!(_la == PLUS || _la == MINUS)) {
										((BinaryOperationContext) _localctx).operator = (Token) _errHandler.recoverInline(this);
									} else {
										if (_input.LA(1) == Token.EOF) matchedEOF = true;
										_errHandler.reportMatch(this);
										consume();
									}
									setState(58);
									((BinaryOperationContext) _localctx).right = expression(8);
								}
								break;
								case 3: {
									_localctx = new TypeConversionContext(new ExpressionContext(_parentctx, _parentState));
									((TypeConversionContext) _localctx).value = _prevctx;
									pushNewRecursionContext(_localctx, _startState, RULE_expression);
									setState(59);
									if (!(precpred(_ctx, 6)))
										throw new FailedPredicateException(this, "precpred(_ctx, 6)");
									setState(60);
									match(AS);
									setState(61);
									((TypeConversionContext) _localctx).targetType = type();
								}
								break;
							}
						}
					}
					setState(66);
					_errHandler.sync(this);
					_alt = getInterpreter().adaptivePredict(_input, 4, _ctx);
				}
			}
		} catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		} finally {
			unrollRecursionContexts(_parentctx);
		}
		return _localctx;
	}

	public static class TypeContext extends ParserRuleContext {
		public TypeContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}

		@Override
		public int getRuleIndex() {
			return RULE_type;
		}

		public TypeContext() {
		}

		public void copyFrom(TypeContext ctx) {
			super.copyFrom(ctx);
		}
	}

	public static class IntegerContext extends TypeContext {
		public TerminalNode INT() {
			return getToken(SandyParser.INT, 0);
		}

		public IntegerContext(TypeContext ctx) {
			copyFrom(ctx);
		}

		@Override
		public void enterRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener) ((SandyParserListener) listener).enterInteger(this);
		}

		@Override
		public void exitRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener) ((SandyParserListener) listener).exitInteger(this);
		}
	}

	public static class DecimalContext extends TypeContext {
		public TerminalNode DECIMAL() {
			return getToken(SandyParser.DECIMAL, 0);
		}

		public DecimalContext(TypeContext ctx) {
			copyFrom(ctx);
		}

		@Override
		public void enterRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener) ((SandyParserListener) listener).enterDecimal(this);
		}

		@Override
		public void exitRule(ParseTreeListener listener) {
			if (listener instanceof SandyParserListener) ((SandyParserListener) listener).exitDecimal(this);
		}
	}

	public final TypeContext type() throws RecognitionException {
		TypeContext _localctx = new TypeContext(_ctx, getState());
		enterRule(_localctx, 14, RULE_type);
		try {
			setState(69);
			_errHandler.sync(this);
			switch (_input.LA(1)) {
				case INT:
					_localctx = new IntegerContext(_localctx);
					enterOuterAlt(_localctx, 1);
				{
					setState(67);
					match(INT);
				}
				break;
				case DECIMAL:
					_localctx = new DecimalContext(_localctx);
					enterOuterAlt(_localctx, 2);
				{
					setState(68);
					match(DECIMAL);
				}
				break;
				default:
					throw new NoViableAltException(this);
			}
		} catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		} finally {
			exitRule();
		}
		return _localctx;
	}

	public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) {
		switch (ruleIndex) {
			case 6:
				return expression_sempred((ExpressionContext) _localctx, predIndex);
		}
		return true;
	}

	private boolean expression_sempred(ExpressionContext _localctx, int predIndex) {
		switch (predIndex) {
			case 0:
				return precpred(_ctx, 8);
			case 1:
				return precpred(_ctx, 7);
			case 2:
				return precpred(_ctx, 6);
		}
		return true;
	}

	public static final String _serializedATN =
			"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\23J\4\2\t\2\4\3\t" +
					"\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\3\2\6\2\24\n\2\r\2" +
					"\16\2\25\3\3\3\3\3\3\3\4\3\4\3\4\5\4\36\n\4\3\5\3\5\3\5\3\5\3\5\3\6\3" +
					"\6\3\6\3\7\3\7\3\7\3\7\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\5\b\66" +
					"\n\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\7\bA\n\b\f\b\16\bD\13\b\3\t\3" +
					"\t\5\tH\n\t\3\t\2\3\16\n\2\4\6\b\n\f\16\20\2\5\3\3\3\3\3\2\16\17\3\2\f" +
					"\r\2L\2\23\3\2\2\2\4\27\3\2\2\2\6\35\3\2\2\2\b\37\3\2\2\2\n$\3\2\2\2\f" +
					"\'\3\2\2\2\16\65\3\2\2\2\20G\3\2\2\2\22\24\5\4\3\2\23\22\3\2\2\2\24\25" +
					"\3\2\2\2\25\23\3\2\2\2\25\26\3\2\2\2\26\3\3\2\2\2\27\30\5\6\4\2\30\31" +
					"\t\2\2\2\31\5\3\2\2\2\32\36\5\n\6\2\33\36\5\f\7\2\34\36\5\b\5\2\35\32" +
					"\3\2\2\2\35\33\3\2\2\2\35\34\3\2\2\2\36\7\3\2\2\2\37 \7\6\2\2 !\7\21\2" +
					"\2!\"\5\16\b\2\"#\7\22\2\2#\t\3\2\2\2$%\7\5\2\2%&\5\f\7\2&\13\3\2\2\2" +
					"\'(\7\23\2\2()\7\20\2\2)*\5\16\b\2*\r\3\2\2\2+,\b\b\1\2,-\7\21\2\2-.\5" +
					"\16\b\2./\7\22\2\2/\66\3\2\2\2\60\66\7\23\2\2\61\62\7\r\2\2\62\66\5\16" +
					"\b\5\63\66\7\n\2\2\64\66\7\13\2\2\65+\3\2\2\2\65\60\3\2\2\2\65\61\3\2" +
					"\2\2\65\63\3\2\2\2\65\64\3\2\2\2\66B\3\2\2\2\678\f\n\2\289\t\3\2\29A\5" +
					"\16\b\13:;\f\t\2\2;<\t\4\2\2<A\5\16\b\n=>\f\b\2\2>?\7\7\2\2?A\5\20\t\2" +
					"@\67\3\2\2\2@:\3\2\2\2@=\3\2\2\2AD\3\2\2\2B@\3\2\2\2BC\3\2\2\2C\17\3\2" +
					"\2\2DB\3\2\2\2EH\7\b\2\2FH\7\t\2\2GE\3\2\2\2GF\3\2\2\2H\21\3\2\2\2\b\25" +
					"\35\65@BG";
	public static final ATN _ATN =
			new ATNDeserializer().deserialize(_serializedATN.toCharArray());

	static {
		_decisionToDFA = new DFA[_ATN.getNumberOfDecisions()];
		for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) {
			_decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i);
		}
	}
}
